package com.t19;

import com.t7.C;
import net.mindview.util.Generator;

import java.util.Random;

/**
 * Created by xuyiwei on 2018/9/12.
 */
enum CartoonCharactr implements Generator<CartoonCharactr>{
    SLAPPY,SPANKY,PUNCHY,SILLY,BOUNCY,BOB;
    private Random random = new Random(47);
    public CartoonCharactr next(){
        return values()[random.nextInt(values().length)];
    }
}
public class EnumImplementation {
    public static <T> void printNext(Generator<T> rg){
        System.out.println(rg.next()+". ");
    }
    public static void main(String[] args) {
        CartoonCharactr cc = CartoonCharactr.BOUNCY;
        for(int i=0;i<10;i++){
            EnumImplementation.printNext(cc);
        }
    }
}
